import { Table, Tag } from 'antd'

const mockData = [
  { id: 1, createdAt: '2023-01-01 10:00', type: 'earn', amount: 100, description: '完成任务奖励' },
  { id: 2, createdAt: '2023-01-02 14:30', type: 'consume', amount: -50, description: '下载资源消耗' }
]

const columns = [
  { title: '时间', dataIndex: 'createdAt', key: 'time' },
  { 
    title: '类型', 
    dataIndex: 'type',
    render: type => <Tag color={type === 'earn' ? 'green' : 'red'}>
      {type === 'earn' ? '获得' : '消耗'}
    </Tag>
  },
  { 
    title: '数量', 
    dataIndex: 'amount',
    render: val => `${val} MV`
  },
  { title: '描述', dataIndex: 'description' }
]

export default function MagicLog() {
  return (
    <Table
      columns={columns}
      rowKey="id"
      dataSource={mockData}
      pagination={{ pageSize: 10 }}
    />
  )
}
